fillRange

Fills a range as replacement for an image size.

Can be used to initialize an image with a set color.

  1. auto fillRange(Image image, Color value)
    @nogc nothrow @safe
    fillRange
    (
    Image
    Color = ImageColor!Image
    )
    (
    Image image
    ,
    Color value
    )
    if (
    isImage!Image
    )
  2. auto fillRange(IRImage image, Color value)

Parameters

image Image

The image to fill as

value Color

The color to fill as

Return Value

Type: auto

An input range that returns value for each pixel in the image

Examples

SwappableImage!RGB8 image = ...;
foreach(pixel; image.fillRange(RGB8(77, 82, 31))) {
    writeln(pixel, " at x:", pixel.x, " y:", pixel.y);
    writeln("\tImage has size width:", pixel.imageWidth, " height:", pixel.imageHeight);
}

Meta